import axios from "../utils/request";
/*
* 编写路径地址
*/
const base={
   baseUrl:"http://localhost:5566",
    homehot1:"/api/home/hot1",
    homehot2:"/api/home/hot2",
    cityUrl:"/api/aj/getcitycode",
    search:"/api/search",
    details:"/api/details",
    login:"/api/login",
    comment:"/api/comment",
    order:"/api/order",
    submitOrderComment:"/api/order/comment"



}
/*
*   编写方法
* */
const api={
    getHomtHot1(params){
      return axios.get(base.baseUrl+base.homehot1,{
          params
      })
    },

    getHomtHot2(params){
        return axios.get(base.baseUrl+base.homehot2,{
            params
        })
    },
    //获取城市列表的参数
    getCityList(){
        return axios.get(base.cityUrl)
    },

    //首页，搜索列表的功能实现
    search(params){
        return axios.get(base.baseUrl+base.search,{
            params
        })
    },

    //搜索的详情
    details(params){
        return axios.get(base.baseUrl+base.details,{
            params
        })
    },
    //登陆的接口
    login(params){
        return axios.post(base.baseUrl+base.login,params)
    },

    //评价的查询接口
    comment(params){
        return axios.get(base.baseUrl+base.comment,{
            params
        })
    },

    //查询订单列表的接口
    order(params){
        return axios.get(base.baseUrl+base.order,{
            params
        })
    },

//定义一个提交评价的接口
    submitOrderComment(params){
        return axios.post(base.baseUrl+base.submitOrderComment,params)
    }

}

export default api;